home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Visual Basic new SourceCode and Projects / Vb E-mail Applictation / NEWMSG.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-04-15  |  8.7 KB  |  274 lines

  1. VERSION 5.00
  2. Begin VB.Form NewMsg 
  3.    Caption         =   "Send Note"
  4.    ClientHeight    =   3135
  5.    ClientLeft      =   1875
  6.    ClientTop       =   2160
  7.    ClientWidth     =   7380
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   400
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form2"
  18.    MDIChild        =   -1  'True
  19.    PaletteMode     =   1  'UseZOrder
  20.    ScaleHeight     =   3135
  21.    ScaleWidth      =   7380
  22.    Begin VB.PictureBox Picture2 
  23.       Align           =   1  'Align Top
  24.       BackColor       =   &H00C0C0C0&
  25.       BorderStyle     =   0  'None
  26.       Height          =   495
  27.       Left            =   0
  28.       ScaleHeight     =   495
  29.       ScaleWidth      =   7380
  30.       TabIndex        =   8
  31.       Top             =   0
  32.       Width           =   7380
  33.       Begin VB.CommandButton CompAdd 
  34.          Caption         =   "A&ddress"
  35.          Height          =   330
  36.          Left            =   5940
  37.          TabIndex        =   13
  38.          Top             =   90
  39.          Width           =   1335
  40.       End
  41.       Begin VB.CommandButton CompOpt 
  42.          Caption         =   "Op&tions"
  43.          Height          =   330
  44.          Left            =   4500
  45.          TabIndex        =   12
  46.          Top             =   90
  47.          Width           =   1335
  48.       End
  49.       Begin VB.CommandButton Attach 
  50.          Caption         =   "&Attach"
  51.          Height          =   330
  52.          Left            =   3060
  53.          TabIndex        =   11
  54.          Top             =   90
  55.          Width           =   1335
  56.       End
  57.       Begin VB.CommandButton ChkNames 
  58.          Caption         =   "Chec&k Names"
  59.          Height          =   330
  60.          Left            =   1620
  61.          TabIndex        =   10
  62.          Top             =   90
  63.          Width           =   1335
  64.       End
  65.       Begin VB.CommandButton Send 
  66.          Caption         =   "&Send"
  67.          Height          =   330
  68.          Left            =   180
  69.          TabIndex        =   9
  70.          Top             =   90
  71.          Width           =   1335
  72.       End
  73.       Begin VB.Line Line2 
  74.          BorderColor     =   &H00FFFFFF&
  75.          X1              =   0
  76.          X2              =   0
  77.          Y1              =   0
  78.          Y2              =   540
  79.       End
  80.       Begin VB.Line TopLine2 
  81.          BorderColor     =   &H00FFFFFF&
  82.          X1              =   0
  83.          X2              =   7380
  84.          Y1              =   0
  85.          Y2              =   0
  86.       End
  87.    End
  88.    Begin VB.TextBox txtNoteText 
  89.       Height          =   1275
  90.       Left            =   0
  91.       MultiLine       =   -1  'True
  92.       ScrollBars      =   2  'Vertical
  93.       TabIndex        =   3
  94.       Top             =   1890
  95.       Width           =   7395
  96.    End
  97.    Begin VB.PictureBox Picture1 
  98.       Align           =   1  'Align Top
  99.       BackColor       =   &H00C0C0C0&
  100.       BorderStyle     =   0  'None
  101.       FillStyle       =   0  'Solid
  102.       Height          =   1395
  103.       Left            =   0
  104.       ScaleHeight     =   1395
  105.       ScaleWidth      =   7380
  106.       TabIndex        =   4
  107.       Top             =   495
  108.       Width           =   7380
  109.       Begin VB.TextBox txtTo 
  110.          BackColor       =   &H00FFFFFF&
  111.          Height          =   285
  112.          Left            =   900
  113.          TabIndex        =   0
  114.          Top             =   180
  115.          Width           =   4995
  116.       End
  117.       Begin VB.TextBox txtcc 
  118.          BackColor       =   &H00FFFFFF&
  119.          Height          =   285
  120.          Left            =   900
  121.          TabIndex        =   1
  122.          Top             =   540
  123.          Width           =   4995
  124.       End
  125.       Begin VB.TextBox txtsubject 
  126.          BackColor       =   &H00FFFFFF&
  127.          Height          =   285
  128.          Left            =   900
  129.          TabIndex        =   2
  130.          Top             =   900
  131.          Width           =   4995
  132.       End
  133.       Begin VB.Line TopLine 
  134.          BorderColor     =   &H00FFFFFF&
  135.          Index           =   1
  136.          X1              =   0
  137.          X2              =   7320
  138.          Y1              =   15
  139.          Y2              =   15
  140.       End
  141.       Begin VB.Line LeftLine 
  142.          BorderColor     =   &H00FFFFFF&
  143.          X1              =   0
  144.          X2              =   0
  145.          Y1              =   0
  146.          Y2              =   1380
  147.       End
  148.       Begin VB.Line TopLine 
  149.          BorderColor     =   &H00000000&
  150.          Index           =   0
  151.          X1              =   0
  152.          X2              =   7320
  153.          Y1              =   0
  154.          Y2              =   0
  155.       End
  156.       Begin VB.Label Label3 
  157.          AutoSize        =   -1  'True
  158.          BackStyle       =   0  'Transparent
  159.          Caption         =   "&To:"
  160.          Height          =   195
  161.          Left            =   120
  162.          TabIndex        =   5
  163.          Top             =   240
  164.          Width           =   300
  165.       End
  166.       Begin VB.Label Label4 
  167.          AutoSize        =   -1  'True
  168.          BackStyle       =   0  'Transparent
  169.          Caption         =   "&Cc:"
  170.          Height          =   195
  171.          Left            =   120
  172.          TabIndex        =   6
  173.          Top             =   600
  174.          Width           =   300
  175.       End
  176.       Begin VB.Label Label5 
  177.          AutoSize        =   -1  'True
  178.          BackStyle       =   0  'Transparent
  179.          Caption         =   "Subj&ect:"
  180.          Height          =   195
  181.          Left            =   120
  182.          TabIndex        =   7
  183.          Top             =   960
  184.          Width           =   720
  185.       End
  186.    End
  187. Attribute VB_Name = "NewMsg"
  188. Attribute VB_GlobalNameSpace = False
  189. Attribute VB_Creatable = False
  190. Attribute VB_PredeclaredId = True
  191. Attribute VB_Exposed = False
  192. Private Sub Attach_Click()
  193. ' Handle attachments.
  194. On Error Resume Next
  195.    VBMail.CMDialog1.DialogTitle = "Attach"
  196.    VBMail.CMDialog1.Filter = "All Files(*.*)|*.*|Text Files(*.txt)|*.txt"
  197.    VBMail.CMDialog1.ShowOpen
  198.    If Err = 0 Then
  199.         On Error GoTo 0
  200.         VBMail.MapiMess.AttachmentIndex = VBMail.MapiMess.AttachmentCount
  201.         VBMail.MapiMess.AttachmentName = VBMail.CMDialog1.FileTitle
  202.         VBMail.MapiMess.AttachmentPathName = VBMail.CMDialog1.FileName
  203.         VBMail.MapiMess.AttachmentPosition = VBMail.MapiMess.AttachmentIndex
  204.         VBMail.MapiMess.AttachmentType = vbAttachTypeData
  205.    End If
  206. End Sub
  207. Private Sub ChkNames_Click()
  208.     ' Resolve the names.
  209.     Call CopyNamestoMsgBuffer(Me, True)
  210.     Call UpdateRecips(Me)
  211. End Sub
  212. Private Sub CompAdd_Click()
  213.     ' Display the address book and update upon return.
  214.     Call CopyNamestoMsgBuffer(Me, False)
  215.     VBMail.MapiMess.Action = vbMessageShowAdBook
  216.     Call UpdateRecips(Me)
  217. End Sub
  218. Private Sub CompOpt_Click()
  219.     ' Display the Message Option form.
  220.     OptionType = conOptionMessage
  221.     MailOptFrm.Show 1
  222. End Sub
  223. Private Sub Form_Activate()
  224.     ' Set the MessageIndex to -1 (Compose Buffer) when this window is activated.
  225.     VBMail.MapiMess.MsgIndex = -1
  226. End Sub
  227. Private Sub Form_Load()
  228.     ' Ensure the windows are sized as needed.
  229.     Call Picture1_Resize
  230.     Call Picture2_Resize
  231.     Call Form_Resize
  232. End Sub
  233. Private Sub Form_Resize()
  234.     ' Adjust the window sizes if the form isn't minimized.
  235.     If WindowState <> 1 Then
  236.         If ScaleHeight > txtNoteText.Top Then
  237.             txtNoteText.Height = ScaleHeight - txtNoteText.Top
  238.             txtNoteText.Width = ScaleWidth
  239.         End If
  240.     End If
  241. End Sub
  242. Private Sub Picture1_Resize()
  243.     ' Update the widths of the fields and adjust the line
  244.     ' controls as needed.
  245.     TopLine(0).X2 = Picture1.Width
  246.     TopLine(1).X2 = Picture1.Width
  247.     Picture1.Refresh
  248. End Sub
  249. Private Sub Picture2_Resize()
  250.     ' Update the widths of the fields and adjust the line
  251.     ' controls as needed.
  252.     TopLine2.X2 = Picture2.Width
  253.     Picture2.Refresh
  254. End Sub
  255. Private Sub Send_Click()
  256.     ' Place the Subject and Note text into the buffer.
  257.     ' Add room in the beginning for attachment files.
  258.     If VBMail.MapiMess.AttachmentCount > 0 Then
  259.         txtNoteText = String$(VBMail.MapiMess.AttachmentCount, "*") + txtNoteText
  260.     End If
  261.     VBMail.MapiMess.MsgSubject = txtsubject
  262.     VBMail.MapiMess.MsgNoteText = txtNoteText
  263.     VBMail.MapiMess.MsgReceiptRequested = ReturnRequest
  264.     Call CopyNamestoMsgBuffer(Me, True)
  265.                   
  266.     On Error Resume Next
  267.     VBMail.MapiMess.Action = vbMessageSend
  268.     If Err Then
  269.         MsgBox "An error occurred during a send: " + Str$(Err)
  270.     Else
  271.         Unload Me
  272.     End If
  273. End Sub
  274.